package com.user.service;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceContextType;

import com.user.entity.User;

/**
 * Session Bean implementation class UserServiceImpl
 */
@Stateless
public class UserServiceImpl implements UserService {

	@PersistenceContext(unitName="MySweetHomeEJB", type = PersistenceContextType.TRANSACTION)
	private EntityManager entityManager;
	
    public User getUser(Long userId){
    	User user = entityManager.find(User.class, userId);
		return user;
    }

}
